/**
 * 
 */
package springbootstudy.hibernate.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import springbootstudy.hibernate.Person;
import springbootstudy.hibernate.repository.PersonRepository;
import springbootstudy.jdbc.repository.PersonDao;

/**
 * @author Administrator
 *
 */
@Service
public class PersonService {

	@Autowired
	private PersonRepository personRepository;
	

	@Autowired
	private PersonDao personDao;

	public void save(Person p) {
		personRepository.save(p);
	}

	public Person findByName(String name) {
		return personRepository.findByName(name);
	}

	public Person findByName2(String name) {
		return personRepository.findByName2(name);
	}
	public Person selectOne(Long id) {
		return personDao.selectOne(id);
	}

}
